<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="../assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="../css/style.css"/>       
        <link href="../assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="../assets/css/ace.min.css" />
        <link rel="stylesheet" href="../assets/css/font-awesome.min.css" />

		<script type="text/javascript">
			window.jQuery || document.write("<script src='../assets/js/jquery-2.0.3.min.js'>"+"<"+"/script>");
		</script>

		

<script type="text/javascript">
			if("ontouchend" in document) document.write("<script src='../assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="../assets/js/bootstrap.min.js"></script>
		<script src="../assets/js/typeahead-bs2.min.js"></script>
		<!-- page specific plugin scripts -->
		<script src="../assets/js/jquery.dataTables.min.js"></script>
		<script src="../assets/js/jquery.dataTables.bootstrap.js"></script>
        <script type="text/javascript" src="../js/H-ui.js"></script> 
        <script type="text/javascript" src="../js/H-ui.admin.js"></script> 
        <script src="../assets/layer/layer.js" type="text/javascript" ></script>
        <script src="../assets/laydate/laydate.js" type="text/javascript"></script>
          <script src="js/jquery-1.9.1.min.js"></script>
        <script>
        
        
 
									function zuofei() {

										var a = $("input[type='checkbox']:checked").length;
                                        
										
										if (a == 1) {

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}
											
											var m=check_val[0];
							
                                           
										
									if (m == null || m == "") {
												alert("请选择编号");
											} else {
												
												
														$.ajax({
															url : "toajax90.do",
															type : "post",
															dataType : "text",
															data : {
																m : m
															},
															success : function(
																	requestXMLTest) {
																var state = requestXMLTest;
																if (state == '未还完') {
																	alert("该合同钱款尚未还完，不能废除");
																} else {
																
																
																     layer.confirm('确认要删除吗？', function(index) {

					$(document.getElementById("t" + m)).remove();

					layer.msg('已删除!', {
						icon : 1,
						time : 1000
					});
					window.location.href = "delete.do?m=" +m;

				});

																}

															}
														});
											}
										} else {
											alert("该操作只能选中一个");

										}

									}

									function qianyue() {

										var a = $("input[type='checkbox']:checked").length;

										if (a == 1) {

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
											}

											id = check_val;

										

											if (id == null || id == "") {
												alert("请选择编号");
											} else {

												var state = document
														.getElementById("st"
																+ id).innerText;
												if (state == '认购') {

													window.location.href = "../indent/qianyue.do?id="
															+ id;

												} else {

													alert("当前状态不可转签约");

												}
											}
										} else {
											alert("该操作只能选中一个");

										}

									}
									
									
									
									
									
									
										function daochu() {

										var a = $("input[type='checkbox']:checked").length;

									if(a>=1){

											obj = document
													.getElementsByName("ck");
											check_val = [];
											for (k in obj) {
												if (obj[k].checked)
													check_val
															.push(obj[k].value);
										    }
										 	
										
											
                                             
								 window.location.href = "../bargain/daochu.do?b="+check_val;
											
										

				}else{
				  alert("请选择要导出的信息");
				  
				  
				
				}
				
				
				
				}		
						
									
									
									
								</script>
        
        
        
        
<title>签约列表</title>
</head>

<body>
<div class="page-content clearfix">
    <div id="Member_Ratings">
      <div class="d_Confirm_Order_style">
    <div class="search_style">
    <form action="select.do" method="post">
      <ul class="search_content clearfix">
       <li><label class="l_f">客户名称：</label><input name="cname" type="text" /></li>
       <li><label class="l_f">业务员名称：</label><input type="text" name="uname"></li>
       <li style="width:90px;"><button type="submit" class="btn_search"><!-- <i class="icon-search"></i> -->查询</button></li>
      </ul>
     </form> 
      
      
    </div>
   
     <div class="border clearfix">
       <span class="l_f">
        <a title="作废" href="javascript:;" onclick="zuofei()" class="btn btn-xs btn-warning" >作废</a>
           <a href="javascript:;" onclick="daochu()" class="btn btn-xs btn-info" >导出</a> 
        </span>

     </div>
 
     <div class="table_menu_list">
      <form name="ff">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
		<thead>
		 <tr>
	    	<th width="25"><label><input type="checkbox" class="ace" name="ck" id="ck" value=""/><span class="lbl"></span></label></th>
				<th width="80">ID</th>
				<th width="200">房间编号</th>
				<th width="100">客户名称</th>
				<th width="120">甲方姓名</th>
				<th width="200">业务员名称</th>
				<th width="100">销售机会编号</th>            
				<th width="250">协议总价</th>
				<th width="250">房间单价</th>
				<th width="250">付款方式</th>
				<th width="250">签订时间</th>
				<th width="250">合同内容</th>
			</tr>
		</thead>
	<tbody>

		
		<c:forEach items="${list}" var="l">
		<tr id="t${l.id}">
          <td><label><input type="checkbox" class="ace" name="ck" id="ck" value="${l.id}"/><span class="lbl"></span></label></td>
          <td>${l.id}</td>
          <td>${l.complex}#${l.unit}#${l.roomname}</td>
          <td>${l.cname}</td>
          <td>${l.jname}</td>
          <td>${l.uname}</td>
           <td>${l.maketingid}</td>
           <td>${l.roomtotal}</td>
           <td>${l.roomprice}</td>
           <td>${l.paymenttypeid}</td>
           <td><fmt:formatDate value="${l.signedtime}" pattern='yyyy-MM-dd'/></td>
          <td>${l.content}</td>
		</tr> 
		
		</c:forEach>
      
      </tbody>
	</table>
	</form>
   </div>
  </div>
 </div>
</div>

  
</body>


</html>





